home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmItsFun
- BackColor = &H00C0C0C0&
- Caption = "The ItsFun Program"
- ClientHeight = 4020
- ClientLeft = 1095
- ClientTop = 1485
- ClientWidth = 7365
- Height = 4425
- Icon = ITFUN.FRX:0000
- Left = 1035
- LinkTopic = "Form1"
- ScaleHeight = 4020
- ScaleWidth = 7365
- Top = 1140
- Width = 7485
- Begin CommandButton cmdClear
- Caption = "&Clear"
- Height = 1215
- Left = 4800
- TabIndex = 3
- Top = 240
- Width = 2175
- End
- Begin TextBox txtMyTextBox
- Alignment = 2 'Center
- Enabled = 0 'False
- Height = 975
- Left = 1440
- MultiLine = -1 'True
- TabIndex = 2
- Top = 1920
- Width = 4695
- End
- Begin CommandButton cmdSaySomething
- Caption = "&Say Something"
- Height = 1215
- Left = 360
- TabIndex = 1
- Top = 240
- Width = 2175
- End
- Begin CommandButton cmdExit
- Caption = "E&xit"
- Height = 510
- Left = 120
- TabIndex = 0
- Top = 3360
- Width = 1215
- End
- ' All variables must be declared before using them.
- Option Explicit
- ' Declare a variable the will hold the session number.
- Dim gSessionNumber
- ' Declare constants
- Const SP_START_OF_FILE = -1
- Const SP_END_OF_FILE = -2
- ' Declare the sp_OpenSession() function from
- ' the TegoSND.DLL library.
- Declare Function sp_OpenSession Lib "TegoSND.DLL" (ByVal lpstrFileName As String) As Integer
- ' Declare the sp_PlaySnd() function from
- ' the TegoSND.DLL library.
- Declare Function sp_PlaySnd Lib "TegoSND.DLL" (ByVal iSessionHandler As Integer, ByVal lStartPoint As Long, ByVal lEndPoint As Long) As Long
- ' Declare the sp_CloseSession() function from
- ' the TegoSND.DLL library.
- Declare Function sp_CloseSession Lib "TegoSND.DLL" (ByVal iSessionHandler As Integer) As Integer
- Sub cmdClear_Click ()
- ' Clear the text box
- txtMyTextBox.Text = ""
- End Sub
- Sub cmdExit_Click ()
- Dim Dummy
- Dummy = sp_CloseSession(gSessionNumber)
- ' Terminate the application
- End
- End Sub
- Sub cmdSaySomething_Click ()
- Dim Dummy
- ' Set the FOntSize property of the text box to 12 points.
- txtMyTextBox.FontSize = 12
- txtMyTextBox.Text = "It's been fun working with you."
- ' Play the WAV file through the PC speaker
- Dummy = sp_PlaySnd(gSessionNumber, SP_START_OF_FILE, SP_END_OF_FILE)
- End Sub
- Sub Form_Load ()
- Dim DriveName As String
- Dim WavFileName As String
- ' Extract the drive name where this program resides
- DriveName = Left(App.Path, 2)
- ' Open a WAV session
- WavFileName = DriveName + "\MVPROG\WAV\ITSBEEN1.WAV"
- gSessionNumber = sp_OpenSession(WavFileName)
- End Sub
- Sub Form_Unload (Cancel As Integer)
- Dim Dummy
- Dummy = sp_CloseSession(gSessionNumber)
- End Sub
-